The rapidly growing database of completely sequenced genomes of bacteria, archaea and eukaryotes (approximately 35 genomes available by the end of 2000 and many more in progress) creates both new opportunities and new challenges for genome research. In order to take advantage of this information, we developed a system of Clusters of Orthologous Groups of proteins (COGs) from 30 completely sequenced genomes. This database is being continuously updated to incorporate newly appearing genomes. The COG allows nearly automatic functional annotation of 60-80% of the proteins encoded in each of the tested bacterial and archaeal genomes, although only about 30% of the eukaryotic proteins fit into these groups. In addition to functional prediction, this approach provides for the systematic delineation of the set of ancient, conserved protein families that are missing in any particular genome. Examination of evolutionary patterns (i.e. representation of different species iand phylogenetic lineages) in the families of orthologs suggests a major role of horizontal gene transfer and lineage-specific gene loss in the evolution of prokaryotes. More specifically, we found evidence of massive horizontal gene among the archaea, between archaea and thermophilic bacteria and between bacterial parasites and their eukaryotic hosts. Additionally, we investigated in detail the lineage-specific gene expansions in prokaryotes and their possible adaptive significance and performed a theoretical of the distribution of evolutionary rates among orthologs from complete genomes.